home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9104.ARJ / 9N04075A < prev    next >
Text File  |  1991-02-19  |  848b  |  31 lines

  1.  
  2. /********************************************************************/
  3. /*                Test the boolean class.                                 */
  4. /********************************************************************/
  5.  
  6. #include <iostream.h>
  7. #include <boolean.hpp>
  8.  
  9. char *test(int i)        { return i ? "okay.\n" : "not okay.\n"; }
  10.  
  11. main()
  12. {
  13.     boolean b1,b2;
  14.  
  15.     cout << "Testing boolean class\n";
  16.     cout << "Constructed value and int() is " << test(b1 == FALSE);
  17.     cout << "Comparison is " << test(b1 == b2);
  18.     b1 = 1;
  19.     cout << "Operator=() is " << test(b1 == true);
  20.     b1 = ~b2;
  21.     cout << "Operator~() is " << test(b1 == true);
  22.     b1++;
  23.     cout << "Operator++() is " << test(b1 == false);
  24.     b1--;
  25.     cout << "Operator--() is " << test(b1 == true);
  26.     cout << "Make_string() is " << b1.make_string() << "ly okay.\n";
  27.  
  28.     true = false;    // This only produces warning message.
  29. }
  30.  
  31.